package com.example.testservice1;

import android.os.Bundle;
import android.app.Activity;
import android.content.Intent;
import android.view.Menu;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;

public class MainActivity extends Activity {

	private Button btnServiceSample;
	private Button btnTest;
	
	private final 
	OnClickListener btnServiceSample_Click= new OnClickListener() {
		@Override
		public void onClick(View v) {
			Intent intent= new Intent(MainActivity.this, MainActivity2.class);
			startActivity(intent);
		}
	};
	
	private final 
	OnClickListener btnTest_Click= new OnClickListener() {
		@Override
		public void onClick(View v) {
		    Intent intent= new Intent(MainActivity.this, TestActivity.class);
            startActivity(intent);
		}
	};
	
	private void initizationComponent() {
	    btnServiceSample= (Button)findViewById(R.id.btnServiceSample);
	    btnServiceSample.setOnClickListener(btnServiceSample_Click);
	    
	    btnTest= (Button)findViewById(R.id.btnTest);
	    btnTest.setOnClickListener(btnTest_Click);
	}
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_main);
		initizationComponent();
	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.main, menu);
		return true;
	}

}
